using UnityEngine;
using QFramework;
using QFramework.Example;

namespace ProjectSurvivor
{
	/// <summary>
	/// 宝箱
	/// </summary>
	public partial class TreasureChest : GameplayObject
	{
		private void OnTriggerEnter2D(Collider2D other)
		{
			if (other.GetComponent<CollectableArea>())
			{
				UIGamePanel.OpenTreasurePanel.Trigger();
				AudioKit.PlaySound("TreasuerChest");
				this.DestroyGameObjGracefully();
			}
		}
		protected override Collider2D Collider2D => SelfCollider2D;
	}
}
